<div class="g-mn">
	    	<b class="spbg2 corner tl"></b>
			<b class="spbg2 corner tr"></b>
			<b class="spbg2 corner bl"></b>
			<b class="spbg2 corner br"></b>
			<div class="titlebar clearfix">FOOTBALL QUIZ</div>
			<?php foreach ($this->matchList as $v):?>
			<?php 
				$teamA = $this->matchInfo->getTeam($v->TeamA);
				$teamB = $this->matchInfo->getTeam($v->TeamB);
				$rateA = $this->matchInfo->getRate($v->MatchID, $teamA['flid']);
				$rateB = $this->matchInfo->getRate($v->MatchID, $teamB['flid']);
			?>
			<div class="jc_mainbox clearfix">
				<div class="teamA"><img width="118" height="124" src="<?php echo $v->TeamALogo;?>" /></div>
				<div class="vsbox">
					<span class="top clearfix">
						<!-- 
						<a href="#" class="spbg t-twitter">twitter</a>
						<a href="#" class="spbg t-facebook">facebook</a>
						 -->
			 			<img src="<?php echo $v->MatchLogo;?>" alt="" width="152" height="56" />
					</span>
					<span class="middle spbg2 clearfix"></span>
					<span class="bottom0"><br /><?php echo date('m-d H:i', $v->MatchTime);?></span>
					<span class="bottom1">
						<ul>
							<li>
								<span class="left">Host team</span>
								<span class="right"><?php echo $rateA['Rate'];?></span>
							</li>
							<li>
								<span class="left">Visiting team</span>
								<span class="right"><?php echo $rateB['Rate'];?></span>
							</li>
						</ul>
					</span>
				</div>
				<div class="teamB" style="width: 115px;"><img width="115" height="124" src="<?php echo $v->TeamBLogo;?>" /></div>
				<div class="choose clearfix">
					<span class="choose_teamA spbg2">
						<?php if ($v->MatchStatus == 0):?>
    						<a class="spbg2" href="javascript:void(0)" onclick="GGSHOP.facematch.chipin(<?php echo $teamA['flid']?>, <?php echo $v->MatchID;?>)">CHOOSE</a>
	    				<?php else:?>
	    					<a style="background-position: 0 -733px;color: #252525;" class="spbg2" href="javascript:void(0)" onclick="GGSHOP.facematch.chipin(<?php echo $teamA['flid']?>, <?php echo $v->MatchID;?>)">CHOOSE</a>
	    				<?php endif;?>
					</span>
					<span class="choose_comment"><?php if ($v->MatchStatus == 0):?>In Progress<?php else:?>Game Over<?php endif;?></span>
					<span class="choose_teamB spbg2">
						<?php if ($v->MatchStatus == 0):?>
	    					<a class="spbg2" href="javascript:void(0)" onclick="GGSHOP.facematch.chipin(<?php echo $teamB['flid']?>, <?php echo $v->MatchID;?>)">CHOOSE</a>
	    				<?php else:?>
	    					<a style="background-position: 0 -733px;color: #252525;" class="spbg2" href="javascript:void(0)" onclick="GGSHOP.facematch.chipin(<?php echo $teamB['flid']?>, <?php echo $v->MatchID;?>)">CHOOSE</a>
	    				<?php endif;?>
					</span>
					<input type="hidden" name="matchstatu" value="<?php echo $v->MatchStatus;?>"></input>
    				<input type="hidden" name="matchid" value="<?php echo $v->MatchID;?>"></input>
				</div>
			</div>
			<?php endforeach;?>
			<div class="pages clearfix">
				<div class="g-pages-style">
					<?php echo $this->pageString;?>
				</div>
			</div>
			<div class="comment_box clearfix">
				<!-- 
				<div class="tips">
					<font>MESSAGE</font>
					<a class="pictures spbg2" href="">Pictures</a>
					<a class="emotion spbg2" href="">Emotion</a>
				</div>
				 -->
				 <a name="comment"></a>
				<div class="message">
					<span class="myhead">
					<?php $user = $this->member->getUserDetails(array('uid'=>$_COOKIE[COOKIE_PRE . 'uid']));?>
					<?php if (!empty($user)):?>
    					<img width="40" height="40" src="<?php if ($user[0]['headimg']){echo $user[0]['headimg'];} else {echo 'images/jc/JC_03.png';}?>" alt="" width="67" height="67"/>
    					<font><?php $row = $this->buyer->getUserDetails(array('uid'=>$_COOKIE[COOKIE_PRE . 'uid'])); echo $row[0]['nick_name'];?></font>
    				<?php else:?>
    					<img width="40" height="40" src="images/jc/JC_03.png" alt="" />
    				<?php endif;?>
					</span>
					<textarea name="comment" id="comment"></textarea>
					<input class="spbg2" type="button" name="Publish" value="Publish" onclick="GGSHOP.facematch.addComment();"/>
				</div>
				<ul class="comment_list" id="list_comment">
					<img alt="loading..." src="images/loading.gif" />
    				<script type="text/javascript">
    					GGSHOP.facematch.loadComment($('input[name="matchid"]').val());
    				</script>					
				</ul>
			</div>
	    </div>
	    <div class="g-mn">
	    	<b class="spbg2 corner tl"></b>
			<b class="spbg2 corner tr"></b>
			<b class="spbg2 corner bl"></b>
			<b class="spbg2 corner br"></b>
			<div class="titlebar clearfix">CLUB RANKING</div>
			<div class="ranking_box clearfix">
				<ul class="left">
					<?php $i = 0;?>
    				<?php foreach ($this->topClub as $v):?>
    				<?php $i++;?>
					<li>
						<span class="color0 no"><?php echo $i;?></span>
						<span class="name"><?php echo $v['en_flname'];?></span>
						<span class="img"><img src="<?php echo $v['logostr'];?>" alt="<?php echo $v['en_flname'];?>"  onerror="javascript:this.src ='/html/images/nothingpic.jpg'" width="36" height="40" /></span>
						<span class="integral">dollar:<strong><?php echo $this->score->score2dollar($v['integral']);?></strong></span>
					</li>
					<?php endforeach;?>					
				</ul>
				<ul class="right">
					<?php $i = 0;?>
    				<?php foreach ($this->topClubMore as $v):?>
    				<?php $i++;?>
					<li>
						<span class="no"><?php echo $i;?>.</span>
						<span class="name"><?php echo $v['en_flname'];?></span>
						<span class="integral">dollar:<?php echo $this->score->score2dollar($v['integral']);?></span>
					</li>
					<?php endforeach;?>					
				</ul>
			</div>
			<div class="titlebar clearfix">DISCUSSION</div>
			<div class="discussion_box clearfix">
				<div class="mr">
					<span class="bar">
						<strong>Member Ranking</strong>
						
					</span>
					<ul>
						<?php $i = 0;?>
						<?php foreach ($this->userArray as $v):?>
						<?php $i++;?>
						<li><?php echo $i;?>.NO: <?php $user = $this->buyer->getUserDetails(array('uid'=>$this->userArray[$i]['uid']));?>
							<?php echo $user[0]['nick_name'];?></li>
						<?php endforeach;?>
						
					</ul>
				</div>
				<div class="lz">
					<span class="bar">
						<strong>League Zonei</strong>
					</span>
					<ul>
					<?php foreach ($this->oldMatchList as $v):?>
						<li><a href="/facematch-index?matchid=<?php echo $v->MatchID;?>"><img src="<?php echo $v->MatchLogo;?>" alt="" width="120" height="45" /></a></li>
					<?php endforeach;?>						
					</ul>
				</div>
			</div>
	    </div>
	    <div class="w-blk0 w-blk-jcwin" id="jc_chipin" style="margin:10px;display: none; position:absolute;">
	      <h2 class="blk0h2 f-iblk clearfix">
	          <span class="spbg blkhdl">BET</span>
	          <span class="spbg blkhdr"><input class="spbg" type="button" value="" onclick="GGSHOP.match.hide();"/></span>
	      </h2>
	      <div class="blkbody">
	         <div class="inner-blkbody">
	             <div class="jctitle">You have $<span class="jdoller" id="my_score">0</span>!</div>
	                 <div class="jccontent">
	                 <input type="text" class="money-input" name="score" id="score" onkeyup="this.value=this.value.replace(/[^\d]/g,'');"/> <input class="bet-btn spbg" type="button" value="BET" onclick="GGSHOP.match.bet();"/>
	             </div>
	         </div>
	      </div>
	 </div>
	  <div class="w-blk0 w-blk-jcwin" id="login" style="margin:10px;display: none; position:absolute;">
	      <h2 class="blk0h2 f-iblk clearfix">
	          <span class="spbg blkhdl">Login</span>
	          <span class="spbg blkhdr"><input class="spbg" type="button" value="" onclick="GGSHOP.facematch.hide();"/></span>
	      </h2>
	      <div class="blkbody">
	         <div class="inner-blkbody">
	         		<div class="jctitle"></div>
	                 <div class="jccontent">
	                 <input class="bet-btn spbg" style="background-position:-204px -1614px; width: 166px; font-size: 11px; padding: 0;margin: 0" type="button" value="CONNECT TO FACEBOOK" onclick="window.showModalDialog('<?php echo $this->loginUrl;?>'); GGSHOP.facematch.hide();"/>
	             	</div>
	         </div>
	      </div>
	 </div>
<script src="http://connect.facebook.net/en_US/all.js#xfbml=1"></script>
<script type="text/javascript">
	GGSHOP.match.loadScore();
</script>   